1. Field of the Invention
The present invention relates to image processing apparatus and methods that perform image processing for images, to computer programs, and to storage media.
2. Description of the Related Art
When a photocopy of an original is made using a copying machine or the like, the color of the paper of the original or the tint color of the background of the original, which is called the “background color”, may be photocopied at the same time. The processing described below is available as image processing suitable for the background color contained in an original image. A brightness (or density) histogram of an image read with a scanner is generated, and the signal level of the background color (background) of the original image (hereinafter, referred to as the “background-color level”) is detected in accordance with the generated histogram. Then, the background-color level is subtracted from an image signal to perform processing for removing the background color from the image (hereinafter, referred to as “removal of the background color”).
A method for removing a background color when a photocopy of an original having the background color is made using a copying machine is suggested, for example, in Japanese Patent Laid-Open No. 11-150657.
When a scanner of a copying machine includes a sensor for detecting the size of an original, the region corresponding to the original is detected by the sensor, and an image of the detected region corresponding to the original is read. Then, a brightness (or density) histogram of the image of the region corresponding to the original is generated, and removal of the background color is performed.
In recent years, general-purpose scanners, personal computers (PCs), and printers have been widely used. Combining a scanner, a PC, and a printer can configure an image copying apparatus. However, since such a general-purpose scanner does not include a sensor for detecting the size of an original, an image including a region outside the original, the region being the largest region readable with the scanner, is input in image input processing. Accordingly, image processing, such as removal of a background color, is performed on the image including the region outside the original. Alternatively, the background color is removed by designating the region corresponding to the original on a PC, by generating a brightness (or density) histogram for the designated region corresponding to the original, and by detecting a background-color level in accordance with the histogram. A method for removing a background color when the region corresponding to an original cannot be detected in advance is suggested, for example, in Japanese Patent Laid-Open No. 2004-349858.
In addition, a method for selecting the region corresponding to a part of an original and for making a photocopy of the selected region is available. When a photocopy of the selected region is made, if the region corresponding to the original has been determined, a background-color level can be detected in accordance with the density of the region corresponding to the entire original. However, if the region corresponding to the original has not been determined, the background-color level is detected in accordance with the density of the selected region to remove the background color.
However, in the method for detecting the background-color level in accordance with the density of the selected region, if the selected region does not contain a large amount of background color, a histogram generated using a density (brightness) signal of the selected region does not include a large amount of color that should be detected as the background color. Thus, the background-color level cannot be detected accurately. None of Japanese Patent Laid-Open Nos. 11-150657 and 2004-349858 disclose a method for appropriately detecting the background-color level of the selected region when part of an original is selected and the selected region does not include a large amount of background color.